<?php $myLib = new myLib(); ?>
<div id="comment_<?php echo $comment->getId() ?>" class="comment background_body" style="margin-bottom: 2px;">
  <div class="photo">
      <?php echo image_tag('/uploads/author/'.$comment->getOwnerId().'.jpg','size=40x40') ?>
  </div>
  <div class="text">
      <div style="padding: 10px;padding-right: 0;display: block;">
          <div style="width: 500px;display: inline-block;vertical-align: middle;">
              <div style="float: right;">
                  <?php echo $myLib->formattedDate($comment->getCreatedAt()) ?>
              </div>
              <b>Pedro Bazán Lévano</b>
              <br /><br />
              <p align="justify">
                  <?php echo $comment->getComment() ?>
              </p>
          </div>
          <div style="width: 30px;display: inline-block;vertical-align: top;text-align: center;">
              <?php if($comment->getOwnerId()==$sf_user->getAttribute('suid')){ ?>
              <a href="javascript:void(0)" title="Delete this comment"
                 onclick="return deleteComentario('<?php echo $comment->getId() ?>');" class="hidden btn_delete">
                  <?php echo image_tag('eliminar.png','size=16x16') ?></a>
              <?php } ?>
          </div>
      </div>
  </div>
</div>

<script type="text/javascript">
$(document).ready(function(){
    $(".comment").hover(function(){
        var id = $(this).attr("id");
        $(".btn_delete").addClass("hidden");
        $("#"+id+" .btn_delete").removeClass("hidden");
    }, function(){
        $(".btn_delete").addClass("hidden");
    });
});
</script>